const mysql = require('mysql')
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'root',
  database: 'juzao',
  multipleStatements:true
})
connection.connect()
module.exports = (sql) => {
  return new Promise(next => {
    connection.query(sql, (err, rows, fields) => {
      if (err) throw err
      // console.log('The solution is: ', rows[0].solution)
      next(rows)
    });
    // connection.end();
    })
}